import React, {useContext} from "react";
import {DatasetImageContext} from "./context";
import {Dialog} from "rc-easyui";
import FormPanel from "./form";

const FormDialog = ({ value, props, close }) => {
    const { ctx, pageConfig, fetchConfig, refs, dataset } = useContext(DatasetImageContext)
    return (
        <Dialog title={props.title} bodyCls="f-column" modal closed={true} ref={value.ref} draggable style={{top: 250}}>
            <FormPanel className="f-full" ctx={ctx} pageConfig={pageConfig} fetchConfig={fetchConfig} {...props} close={close} refs={refs} dataset={dataset} />
        </Dialog>
    )
}

export {
    FormDialog
}